
window.onload = function(){

	var urlip = '116.85.19.102';
	localStorage.setItem('urlip',urlip)
	

	// H5 plus事件处理
	function plusReady(){
		// Android处理返回键
		plus.key.addEventListener('backbutton',function(){
			('iOS'==plus.os.name)?plus.nativeUI.confirm('确认退出？', function(e){
				if(e.index>0){
					plus.runtime.quit();
				}
			}, 'HelloH5', ['取消','确定']):(confirm('确认退出？')&&plus.runtime.quit());
		},false);
		// 关闭启动界面
		plus.navigator.setStatusBarBackground('#D74B28');
		setTimeout(function(){
			plus.navigator.closeSplashscreen();
		},200);
		
	}
	
	if(window.plus){
		plusReady();
		var imei = plus.device.imei;
		if(!window.localStorage){
			alert("不支持localStorage");
			return false;
		}else{
			localStorage.setItem('imei',imei)
		}
	}else{
		document.addEventListener('plusready',plusReady,false);
	}
	
	
	var head= document.getElementsByTagName('head')[0]; 
    var script= document.createElement('script'); 
    script.type= 'text/javascript'; 
    script.src= './js/update.js'; 
    head.appendChild(script); 
	
	var updatebody = document.getElementsByTagName('body')[0]; 
	var updateNode = document.createElement('div'); 
	updateNode.setAttribute("id", "updateModalContain");
	updatebody.appendChild(updateNode);
	var updateModalObj = document.getElementById('updateModalContain');
	updateModalObj.innerHTML = '<div class="update-modal-fixed" id="updateModal"><div class="update-modal-contain">'+
								'<div class="update-modal"><div class="update-modal-head"><span id="updateModalTitle">升级提示</span></div>'+
								'<div class="update-modal-body" id="updateModalBody"></div><div class="update-modal-foot">'+
								'<button type="button" id="updateBtn">立即更新</button></div></div></div></div>';
	
	

	
};

